#include<bits/stdc++.h>
using namespace std;
int main()
{
	freopen("replace.in","r",stdin);
	freopen("replace.out","W",stdout);
	int a,b;
	char x,y,p,q,m,n,f,e,l,k;
	cin>>a>>b;
	cin>>x>>y;
	cin>>p>>q;
	cin>>m>>n;
	cin>>e>>f;
	cin>>l>>k;
	cout<<2<<endl;
	cout<<0<<endl;
	return 0;
}
